package com.tree.backend.controller;

import com.tree.backend.common.Result;
import com.tree.backend.entity.vo.ActivityTrend;
import com.tree.backend.entity.vo.OrgActivityStats;
import com.tree.backend.service.IPartyActivityService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 党建活动记录表，记录各类党建活动的基本信息和成果 前端控制器
 * </p>
 *
 * @author tree
 * @since 2025-10-15
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/party-activity")
public class PartyActivityController {

    private final IPartyActivityService partyActivityService;
    @GetMapping("/organization-stats")
    public Result<List<OrgActivityStats>> organizationStats(){
        return Result.success( partyActivityService.organizationStats());
    }

    @GetMapping("/trend")
    public Result<List<ActivityTrend>> trend(){
        return Result.success(partyActivityService.trend());
    }
}
